#include "myStdio.h"

int main()
{
    MYFILE* fp = myfopen("log.txt", "w");
    if(fp == NULL)
    {
        perror("myfopen");
        return 1;
    }
    const char* buff = "hello totoro!";
    int cnt = 10;
    while(cnt--)
    {
        myfwrite(buff, strlen(buff), fp);
        printf("%s", fp->outBuff);
        sleep(1);
    }
    myfclose(fp);
    return 0;
}
